﻿Imports SdlDotNet.Graphics
Imports System.Drawing

Public Class City
    Public Position As Point
    Public Health As Integer = 100

    Public Sub New(ByVal position As Point)
        Me.Position = position
    End Sub

    Public Sub Draw(ByVal display As surface)
        If (Health > 100) Then
            display.Blit(CitySprites.Metropolis, Position)
        ElseIf (Health >= 81) Then
            display.Blit(CitySprites.LargeCity, Position)
        ElseIf (Health >= 61) Then
            display.Blit(CitySprites.SmallCity, Position)
        ElseIf (Health >= 41) Then
            display.Blit(CitySprites.Town, Position)
        ElseIf (Health >= 21) Then
            display.Blit(CitySprites.Village, Position)
        ElseIf (Health >= 1) Then
            display.Blit(CitySprites.Hut, Position)
        Else
            display.Blit(CitySprites.Crater, Position)
        End If
    End Sub

    Public Function IntersectsWithPoint(ByVal point As Point) As Boolean
        If (point.X >= Position.X And point.X <= CitySprites.LargeCity.Width + Position.X) Then
            If (point.Y >= Position.Y And point.Y <= CitySprites.LargeCity.Height + Position.Y) Then
                Return True
            End If
        End If
        Return False
    End Function
End Class
